package RemotePlay.test;

import java.net.MalformedURLException;
//import java.rmi.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;

public class HelloRmiClient {
    IntHelloRmi helloRmi;

    public void client() throws RemoteException, MalformedURLException, NotBoundException {
        try {
            helloRmi = (IntHelloRmi) Naming.lookup("rmi://localhost:9999/HelloRmi");
            System.out.println("client:");
            System.out.println(helloRmi.helloRmi());
            System.out.println(helloRmi.sayHello("rmi"));
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
    }
}